import http from '@/utils/http'

/**
 * @description 订单信息
 */
export const reqOrderInfo = () => {
  return http.get('/order/trade')
}
/**
 * @description 默认收货地址
 */
export const reqOrderAddress = () => {
  return http.get('/userAddress/getOrderAddress')
}
/**
 * @description 立即购买
 * @param {*} param0
 */
export const reqOrderBuyNow = ({ goodsId, ...data }) => {
  return http.get(`/order/buy/${goodsId}`, data)
}
/**
 * @description 提交订单信息
 */
export const reqSubmitOrder = (data) => {
  return http.post('/order/submitOrder', data)
}
/**
 * @description 预支付详细
 */
export const reqPrePayInfo = (orderNo) => {
  return http.get(`/webChat/createJsapi/${orderNo}`)
}

/**
 * @description 支付结果
 * @param {*} orderNo
 */
export const reqPayStatus = (orderNo) => {
  return http.get(`/webChat/queryPayStatus/${orderNo}`)
}
